package com.slkj.shilixiaoyuanapp.ui.teacher.tool.MaterialAudit;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.api.InjectParam;
import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.base.ActivityInfo;
import com.slkj.shilixiaoyuanapp.base.BaseActivity;
import com.slkj.shilixiaoyuanapp.entity.MaterialAuditEntity;
import com.slkj.shilixiaoyuanapp.net.HttpHeper;
import com.slkj.shilixiaoyuanapp.net.callback.CommonCallBack;
import com.slkj.shilixiaoyuanapp.view.CustomStateText;
import com.slkj.shilixiaoyuanapp.view.StateLayout;

import butterknife.BindView;
import butterknife.ButterKnife;

@ActivityInfo(layout = R.layout.activity_materia_audit_dsp, title = "待审批")
public class MateriaAuditActivity extends BaseActivity {

    @InjectParam
    int id;
    @InjectParam
    int type;
    @BindView(R.id.tv_type111)
    TextView tvType111;
    @BindView(R.id.tv_type)
    TextView tvType;
    @BindView(R.id.layout_chose_type)
    RelativeLayout layoutChoseType;
    @BindView(R.id.tv_type2)
    TextView tvType2;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.layout_chose_time)
    RelativeLayout layoutChoseTime;
    @BindView(R.id.tv_type6)
    TextView tvType6;
    @BindView(R.id.tv_spr)
    TextView tvSpr;
    @BindView(R.id.layout_chose_spr)
    RelativeLayout layoutChoseSpr;
    @BindView(R.id.tv_type666)
    TextView tvType666;
    @BindView(R.id.tv_type4)
    TextView tvType4;
    @BindView(R.id.layout_chose_pic)
    RelativeLayout layoutChosePic;
    @BindView(R.id.recyc_pic)
    RecyclerView recycPic;
    @BindView(R.id.tv_cx)
    CustomStateText tvCx;
    @BindView(R.id.tv_cb)
    CustomStateText tvCb;
    @BindView(R.id.statelayout)
    StateLayout statelayout;

    @Override
    protected void init() {
        MateriaAuditActivity__JumpCenter.bind(this);
        getData();
        statelayout.setOnReLoadListener(this::getData);

    }

   void getData(){
       HttpHeper.get().toolService()
               .getMaterialAuditDetails(id)
               .compose(getThread())
               .compose(bindToLifecycle())
               .subscribe(new CommonCallBack<MaterialAuditEntity>(statelayout) {
                   @Override
                   public void onCallBackSuccess(MaterialAuditEntity data) {
                        setView(data);
                   }
               });
   }

    /**
     * getview设置数据
     * @param data
     */
    private void setView(MaterialAuditEntity data) {

    }
}
